package com.cy.detectsys.mapper;

import com.cy.detectsys.entity.DetectMissionTarget;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cy.detectsys.entity.DetectTarget;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author admin
* @description 针对表【detect_mission_target】的数据库操作Mapper
* @createDate 2024-05-08 23:41:54
* @Entity com.cy.detectsys.entity.DetectMissionTarget
*/
public interface DetectMissionTargetMapper extends BaseMapper<DetectMissionTarget> {

    @Select("SELECT\n" +
            "\tcount( 1 ) \n" +
            "FROM\n" +
            "\t`detect_mission_target`\n" +
            "\tJOIN `detect_target` ON `detect_target`.id = `detect_mission_target`.`ky_net_target_id` \n" +
            "WHERE\n" +
            "\t`detect_mission_target`.`ky_mission_id` = #{id} \n" +
            "\tAND `detect_mission_target`.`deleted` = 0")
    Integer getTargetCountByMissionID(String id);
    @Select("SELECT\n" +
            "\t `detect_target`.* \n" +
            "FROM\n" +
            "\t`detect_mission_target`\n" +
            "\tJOIN `detect_target` ON `detect_target`.id = `detect_mission_target`.`ky_net_target_id` \n" +
            "WHERE\n" +
            "\t`detect_mission_target`.`ky_mission_id` = #{id} \n" +
            "\tAND `detect_mission_target`.`deleted` = 0")
    List<DetectTarget> getTargetIdByMissionID(String missionId);
}




